|
2020-2021 Sunseeker Telemetry and Lighting System
|
#include "driverlib.h"Go to the source code of this file.
Macros | |
| #define | SLAVE_ADDRESS 0x48 |
Functions | |
| void | main (void) |
| void | USCIB0_ISR (void) |
Variables | |
| uint8_t | RXData |
| #define SLAVE_ADDRESS 0x48 |
This example shows how to configure the I2C module as a slave for single byte reception in interrupt driven mode. The address of the slave module is set in this example. EUSCI_B0 I2C Slave RX single bytes from MSP430 Master
Description: This demo connects two MSP430's via the I2C bus. The master transmits to the slave. This is the slave code. The interrupt driven data receiption is demonstrated using the USCI_B0 RX interrupt.
Tested on MSP430FR4133
/|\ /|\
MSP430FR4133 10k 10k MSP430FR4133
slave | | master
----------------- | | -----------------
-|XIN P5.2/UCB0SDA|<-|----+->|P5.2/UCB0SDA XIN|-
| | | | | 32kHz
-|XOUT | | | XOUT|-
| P5.3/UCB0SCL|<-+------>|P5.3/UCB0SCL |
| | | P1.0|--> LED
This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:
This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.
Definition at line 82 of file eusci_b_i2c_ex4_slaveRxSingle.c.
| void main | ( | void | ) |
Definition at line 86 of file eusci_b_i2c_ex4_slaveRxSingle.c.
References __no_operation(), and param.
| void USCIB0_ISR | ( | void | ) |
Definition at line 134 of file eusci_b_i2c_ex4_slaveRxSingle.c.
References RXData.
| uint8_t RXData |
Definition at line 84 of file eusci_b_i2c_ex4_slaveRxSingle.c.